bool chkPalindrome(ListNode* A) {
    int arr[900] = { 0 };
    int i = 0;
    ListNode* temp = A;
    while (temp)
    {
        arr[i++] = temp->val;
        temp = temp->next;
    }
    int prev = 0;
    int pcur = i - 1;
    while (prev < pcur) {
        if (arr[prev] != arr[pcur])
        {
            return false;
        }
        prev++;
        pcur--;
    }
    return true;
}